package com.tedu.web.config;

import com.tedu.web.interceptor.TimeAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
 * 定义spring web模块的配置类
 * */
@Configuration
public class springconfigweb  implements WebMvcConfigurer {
    /**
     * 注册拦截器
     * */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
            registry.addInterceptor(new TimeAccessInterceptor())
                     // .excludePathPatterns();//放行
                    //设置要拦截的路径
                    .addPathPatterns("/notice/*");
    }
}
